package gone;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

public class Menu {

	public static void main(String[] args)
	{
		JFrame frame=new JFrame();

		//frame.add(button);
		frame.setTitle("Task Manager v1.0");
		frame.setSize(500,600);
		frame.setLocationRelativeTo(null);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);

		JMenuBar menubar=new JMenuBar();
		
		JMenu menu=new JMenu("File");
		menubar.add(menu);
		
		JMenuItem mitem1= new JMenuItem("New Task");
		JMenuItem mitem2= new JMenuItem("Exit");
		menu.add(mitem1);
		menu.add(mitem2);
		frame.add(menubar);
		class exitaction implements ActionListener{
			public void actionPerformed(ActionEvent e){
				System.exit(0);
				
			}
		}
		mitem1.addActionListener(new exitaction());

	}
}
